package com.panopset.centralen.resource;

import java.net.URL;

/**
 * Resource accessor.
 *
 * @author Karl Dinwiddie
 *
 */
public final class Accessor {

    /**
     * Get the URL for an application package resource.
     *
     * @param resourcePath
     *            Full path, ie: &quot;com/company/icon.png&quot;
     * @return URL for resource
     */
    public static URL getPackageURL(final String resourcePath) {
        URL rtn = ClassLoader.getSystemResource(resourcePath);
        if (rtn == null) {
            rtn = Accessor.class.getResource(resourcePath);
        }
        return rtn;
    }

    /**
     * Prevent instantiation.
     */
    private Accessor() { }
}
